package com.galaxy.coupon.domain;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.galaxy.common.mybatis.core.domain.BaseEntity;
import com.galaxy.coupon.domain.vo.CouponTemplateVo;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.util.Date;

/**
 * 积分兑换规则对象
 */
@Data
@EqualsAndHashCode(callSuper = true)
@TableName("points_exchange_rule")
public class PointsExchangeRule extends BaseEntity {
    private static final long serialVersionUID = 1L;

    /** 主键 */
    @TableId(type = IdType.AUTO)
    private Long id;

    /** 优惠券ID */
    private Long couponId;

    /** 所需积分 */
    private Integer points;

    /** 每人兑换上限(次) */
    private Integer exchangeLimit;

    /** 兑换开始时间 */
    private Date startTime;

    /** 兑换结束时间 */
    private Date endTime;

    /** 状态(0:未启用,1:已启用,2:已结束) */
    private Integer status;

    /** 规则描述 */
    private String description;

    @TableField(exist = false)
    private CouponTemplateVo coupon;
}
